/*
 * Demonstrate escape sequences in strings.
 * From A-Z, 4 letters per line.
 *
 * Program written by John Kim on Thu Jan  2 09:47:14 PST 2014
 *  v0.1 initial release. (2014-01-02)
 */
class johnStrDemo {
    public static void main(String args[]) {
        char ab, oab, hab; // Decimal, octal, and hexadecimal literals respectively.
        int letters, counter;

        counter = 0;

        // 65 in decimal is A.
        ab = 65;

        // 60 in octal is 0. Remember, octals start with 0.
        oab = 060;

        // 61 in hexadecimal is a. Remember, hexadecimals start with 0x.
        hab = 0x61;

        System.out.println("Set of A-Z\nIn Decimal");

        for(letters = 1;letters <= 26 ; letters++) {
           System.out.print(ab + "\t");
           ab++;

           counter++;
           // New line every four letters
           if(counter == 4) {
               System.out.println();
               counter = 0;
           } 
        }

        // Start two new lines.
        // println + \n = 2
        System.out.println("\n");
        counter = 0;

        System.out.println("Set of 0-9\nIn Octal");

        for(letters = 1;letters <= 10 ; letters++) {
           System.out.print(oab + "\t");
           oab++;

           counter++;
           // New line every 5 numbers
           if(counter == 5) {
               System.out.println();
               counter = 0;
           } 
        }

        System.out.println("\n");
        counter = 0;

        System.out.println("Set of a-z\nIn Hexadecimal");

        for(letters = 1;letters <= 26 ; letters++) {
           System.out.print(hab + "\t");
           hab++;

           counter++;
           // New line every 4 letters
           if(counter == 4) {
               System.out.println();
               counter = 0;
           } 
        }

        // Start a new line.
        System.out.println();
    }
}
